import numpy as np
import pandas as pd
a=np.random.randint(1,100,5)
print('一维原始数组：\n',a)
print('等差分段离散化数据：\n',pd.cut(a,bins=5))
print('自定义分段离散化数据：\n',pd.cut(a,bins=[0,20,40,60,80,100]))
print('自定义分段离散化数据，并设置分段标签：\n',pd.cut(a,bins=[0,20,40,60,80,100],labels=['0+','20+','40+','60+','80+']))
